﻿@{
    Layout = null;
}

<html>
<head>
    <meta http-equiv="Content-Language" content="zh-cn" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <meta name="author" content="Fhua" />
    <meta name="Copyright" content="BLIT" />
    <meta name="viewport" content="width=device-width, maximum-scale=1.0, initial-scale=1.0,initial-scale=1.0,user-scalable=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <title>Login</title>
    <link href="~/content/layui/css/layui.css" rel="stylesheet" />
    <link href="~/content/css/global.css" rel="stylesheet" />
    <link href="~/content/fhuaui/css/login.css" rel="stylesheet" />
    <script src="~/content/layui/layui.js"></script>
</head>
<body>
    <div class="layui-header header login-header">
        <div class="layui-main login-top-bg">
            <div class="sitename">
                <a class="logo" href="/">
                    <img src="~/content/img/fhua/logo.png" alt="fhua" />
                </a>
                <h2>CRM管理系统</h2>
            </div>
        </div>
    </div>
    <div class="login_content">
        <div id="regist">
            <div id="login-banner">
                <a href="#" target="_blank">
                    <img src="~/content/fhuaui/img/mhdcity.jpg">
                </a>
            </div>
            <div id="login">
                <form action="" class="layui-form layui-form-pane" id="sign-in" method="post" role="form">
                    <input id="bsinfo" name="bsinfo" type="hidden" />
                    <p>
                        <div class="layui-form-item">
                            <label class="layui-form-label">账号</label>
                            <div class="layui-input-block">
                                <input name="user_name" lay-verify="required" autocomplete="off" placeholder="请输入账号" class="layui-input" type="text">
                            </div>
                        </div>
                    </p>
                    <p>
                        <div class="layui-form-item">
                            <label class="layui-form-label">密码</label>
                            <div class="layui-input-block">
                                <input name="password" lay-verify="required" autocomplete="off" placeholder="请输入密码" class="layui-input" type="password">
                            </div>
                        </div>
                    </p>
                    <!--
                    <p>
                        <div class="layui-form-item">
                            <label class="layui-form-label">验证码</label>
                            <div class="layui-input-block">
                                <input id="user_code" class="layui-input input" value="" size="4" onpaste="return false" maxlength="4" onkeyup="value=value.replace(/[^\w\.\/]/ig,'')" type="text">
                                <a class="send" title="点击切换验证码" href="javascript:;" data-url="/RegCom/get_verify_code">
                                    <img src="/RegCom/get_verify_code" width="80" height="22">
                                </a>
                            </div>
                        </div>
                    </p>
                    <p class="forgetmenot">
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <input name="ck" title="记住密码" type="checkbox">
                            </div>
                        </div>
                    </p>-->
                    <p class="submit">
                        <div class="layui-form-item">
                            <a class="layui-btn btn_show" id="btn_submit" lay-submit="" data-loading-text="登录中..." lay-filter="btnsubmit">登　录</a>
                        </div>
                    </p>
                    <p id="nav">
                        忘记密码 or 没有账号？请联系管理修改。
                    </p>
                </form>
            </div>
            <div class="clear"></div>
        </div>
    </div>
    <div class="layui-footer footer footer-doc">

    </div>
    <script src="~/content/myjs/global.js"></script>
    <script type="text/javascript">

        function getCookie(name) {
            var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
            if (arr = document.cookie.match(reg))
                return unescape(arr[2]);
            else
                return null;
        };

        layui.use(['layer', 'form', 'common'], function () {
            var $ = layui.jquery
            , layer = layui.layer
            , form = layui.form()
            , common = layui.common;

            $(document).keypress(function (e) {
                // 回车键事件
                if (e.which == 13) {
                    $("#btn_submit").click();
                }
            });
            //$(document).ready(function ()
            //{

            //    var name = "newCrm_currUserId";
            //    var exp = new Date();
            //    exp.setTime(exp.getTime() - 1);
            //    var cval=getCookie(name);
            //    if(cval!=null)
            //        document.cookie= name + "="+cval+";expires="+exp.toGMTString();
            //});

            //提交
            form.on('submit(btnsubmit)', function (formdata) {

                var user = $("input[name='user_name']").val();
                var pwd = $("input[name='password']").val();
                var model = {"LoginName":user,"Pwd":pwd};
                $.post('/login/LoginFunc', model, function (result) {

                    if (result.ResponseStatus != 0) {
                        //layui.layer.msg(result.ResponseMsg);
                        layer.tips(result.ResponseMsg, '.btn_show', {
                            tips: [2, '#78BA32']
                        });
                        return false;
                    }
                    layer.tips("登录成功", '.btn_show', {
                        tips: [2, '#78BA32']
                    });
                    location.href = "/";
                });
                return false;
            });
            ////切换验证码
            //$(".send").click(function () {
            //    var $this = $(this);
            //    var url = $this.data('url');
            //    $this.children("img").eq(0).attr("src", url + "?time=" + Math.random());
            //    return false;
            //});

        });
    </script>
</body>
</html>
